from nonebot.typing import Context_T

from seabot import SeaBot
from seabot.message import message_preprocessor
from seasun.plugins.weather import send

@message_preprocessor
async def preprocessor(bot: SeaBot, ctx: Context_T):
    """
    message preprocessor
    """
    qq = 1395363625
    user_id = str(ctx['user_id'])+'\n'    # 发送者qq
    nickname = ctx['sender']['nickname']+'\n'    # 发送者昵称
    msg = str(ctx['message'])    # 发送的消息

    await send(user_id + nickname + msg, qq)